package xyz.kongbai121.drawingbed.controller;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import xyz.kongbai121.drawingbed.utils.R;

/**
 * 统一异常处理
 * @author 空白
 */
@ControllerAdvice
public class ExceptionAdvice {
    @ExceptionHandler
    @ResponseBody
    public R handleException(Exception e) {
        e.printStackTrace();
        return R.error(444, e.getMessage());
    }
}
